package com.ayit.car.car_data;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;

public class WebDownloader {
    public static String downloadHtml(String url) {
        StringBuilder html = new StringBuilder();
        try {
            URL targetUrl = new URL(url);
            BufferedReader reader = new BufferedReader(new InputStreamReader(targetUrl.openStream(), "GBK"));
            String line;
            while ((line = reader.readLine()) != null) {
                html.append(line);
            }
            reader.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return html.toString();
    }
}
